package com.jay.tools.adapter;


import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;

import java.util.List;

/**
 * author: tanjianpei
 * date: 2018/9/6 006 9:36
 * <p>
 * description:
 */
public class MyFragmentAdapter extends FragmentStatePagerAdapter {

    private List<Fragment> mFragments;

    public MyFragmentAdapter(FragmentManager fm, List<Fragment> fragments) {
        super(fm);
        mFragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return mFragments.get(position);
    }

    @Override
    public int getCount() {
        return null == mFragments ? 0 : mFragments.size();
    }
}
